//
//  imageCell.m
//  movie
//
//  Created by 李丹阳 on 15/7/22.
//  Copyright (c) 2015年 李丹阳. All rights reserved.
//

#import "imageCell.h"

@implementation imageCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self _createSubView];
    }
    return self;
}

- (void)setModal:(ImageModal *)modal{
    _modal = modal;
    [self setNeedsDisplay];
}

- (void)_createSubView{
    _image = [[UIImageView alloc]initWithFrame:self.bounds];
    _image.layer.borderWidth = 1;
    _image.layer.borderColor = [[UIColor whiteColor] CGColor ];
    _image.layer.cornerRadius = 5;
    [self.contentView addSubview:self.image];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    [self.image sd_setImageWithURL:[NSURL URLWithString:self.modal.image]];
    [self.contentView addSubview:self.image];
}
@end
